﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(PanelView))]
public class EditorPanelItem : Editor
{
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        PanelView panelItem = (PanelView) target;
        
        GUILayout.Label("拖动位置后，点击保存后生效");
        
        
        if (GUILayout.Button("更新布局"))
        {
            panelItem.ApplyViewPos();
            panelItem.UpdateLayOut();
        }

        
        GUILayout.Label("点击删除后需要手动删除");
        if (GUILayout.Button("删除"))
        {
            panelItem.Delete();
            Debug.Log("删除成功！");
        }
    }
}
